import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    userid:sessionStorage.getItem("id"),
    username:sessionStorage.getItem("username"),
    islogin:sessionStorage.getItem("islogin"),
  },
  mutations: {
    setUserid(state,val){
      state.userid=val;
    },
    setUsername(state,val){
      state.username=val;
      state.islogin=1
    },
    setIslogin(state,val){
      state.islogin=val
    },
  },
  actions: {
  },
  modules: {
  }
})
